-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: custom paymaster handler & zyfi integration #51
Conversation
Overall, the addition of BEFORE const zksyncConnector = zksyncSsoConnector({
authServerUrl: "http://localhost:3002/confirm",
paymasterHandler: async () => ({
paymaster: PaymasterContract.address,
paymasterInput: getGeneralPaymasterInput({ innerInput: "0x" }),
}),
}); AFTER const zksyncConnector = zksyncSsoConnector({
authServerUrl: "http://localhost:3002/confirm",
paymasterHandler: createGeneralPaymaster(PaymasterContract.address),
}); |
@0xSulpiride Repos within |
41439c3
41439c3
to
ff2b672
Compare
@MexicanAce thanks for instructions. rebased with signed commits |
@MexicanAce the PR is ready to be merged 🚀 |
Description
Added paymaster plugin support that enables developers to create external paymaster plugins that integrate with SDK easily.
Key changes:
CustomPaymasterHandler
type and integration in transaction flowfeat: paymaster handler in session keys
feat: paymaster handler in passkeys
feat: general paymaster handler
feat: zyfi paymaster handler
wip: add paymaster in writeContract flow
Additional context
With these changes users can start using external paymasters easily with just 2-3 lines of code
How it works:
customPaymasterHandler
acts as a middleware which is triggered just before signing a transaction.Simplest paymaster handler will just add static
paymaster
andpaymasterInput
to a transaction.The more complex one, like ZyFi's, will send the transaction to some backend service and can fetch not only paymasterInput, but also gas fees since some paymasters may rely on exact values of these fields to account for ERC20 tokens.